<%@ page pageEncoding="UTF-8"%>

<%@ taglib uri="/tags/struts-tiles" prefix="tiles"%>
<%@ taglib uri="/tags/struts-html" prefix="html"%>
<%@ taglib uri="/tags/struts-logic" prefix="logic"%>
<%@ taglib uri="/tags/struts-nested" prefix="nested"%>
<%@ taglib uri="/tags/struts-bean" prefix="bean"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix='fmt'%>
<%@ taglib uri="/tags/trymore" prefix="tm"%>

<style>
	.tbl td {border-color: #797979}
	#tblexp td.banner {line-height: 35px; font-size: 18px; font-weight: bold; text-align: center; margin: 0;}
	#tblexp td.field {background-color: #CFDBEC; line-height: 25px; text-align: center; margin: 0; width: 100px; font-size: 9pt;}
	#tblexp input.textInput {float:none;margin: 5px; width: 80px; height: 23px;}
	.export_present {display:none;}
	div.mf_container {margin: 5px;}
</style>

<script src="resources/js/jquery/jmainfest/jquery.ui.widget.min.js" type="text/javascript"></script>
<script src="resources/js/jquery/jmainfest/jquery.marcopolo.js" type="text/javascript"></script>
<script src="resources/js/jquery/jmainfest/jquery.manifest.js" type="text/javascript"></script>

<script>
	$(function(){
	
		var current_panel = $.pdialog.getCurrent() && $.pdialog.getCurrent().filter(":visible").length > 0 ? $.pdialog.getCurrent() : navTab.getCurrentPanel();
		
		$('#project_participants', current_panel).manifest({
			// Use each location's full name as the display text.
			formatDisplay: function (data, $item, $mpItem) {
				return data.username;
			},
			// Use each location's ID as the value to be submitted.
			formatValue: function (data, $value, $item, $mpItem) {
				return data.id;
			},
			<logic:present name="projectAttendees">
			values: eval(${projectAttendees}),
			</logic:present>
			valuesName: 'projectAttendeeId',
			<c:choose>
				<c:when test="${op ne null && op eq 'view' || op eq 'audit' || op eq 'post_stuff'}">
					readonly: true,
				</c:when>
				<c:otherwise>
					marcoPolo: {
						url: 'app/base.do?action=lookupUserByName',
						formatItem: function (data) {
						  return '"' + data.username + '" (' + data.userNo + ')';
						},
						param: 'search'
					}
				</c:otherwise>
			</c:choose>
		});
		
		$("#audit_post_confer").unbind("click");
		$("#audit_post_confer").click(function(){
			if ($("input[type=radio]").filter(":checked").size() == 0) {
				alertMsg.error("请选择审批状态...");
				return;
			} 
			
			$("#auditConferForm").submit();
		});
	});
</script>

<!-- Body -->
<form id="auditConferForm" method="post" action="app/project/audit.do?action=actionAuditProjectConference" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone);">	
	<div class="pageFormContent" layoutH="${pid ne null ? (flag ne null ? 58 : 95) : 55}" style="border-top: none; background-color: #FFF">	
		<div align="center" style="line-height: 35px; font-size: 28px; font-weight: bold; margin-bottom: 10px">${entity.process.dependedFlow.nodeTitle}申请表</div>
		<div id="finaexp_print_wrapper">
			<table class="tbl" id="tblexp" cellpadding="0" cellspacing="0" width="98%" border="1" style="border-collapse: collapse; border-color: #797979; margin: 0 auto;" rules="all">
				<tr>
					<td class='field'>申请人</td>
					<td>
						<input type="text" style="width: 90%;" readonly value="${entity ne null && entity.author ne null ? entity.author.username : ''}" />
					</td>
					<td class='field'>填表时间</td>
					<td colspan="3">
						<input type="text" style="width: 97%;" readonly value="<fmt:formatDate value='${entity.creationTime}' type='date' pattern='yyyy-MM-dd'/>" />
					</td>
					<td class='field' style="background-color: #FF9500;">会议时间</td>
					<td>
						<input type="text" style="width: 90%;" readonly value="<fmt:formatDate value='${entity.conferenceTime}' type='date' pattern='yyyy-MM-dd HH:mm'/>" />
					</td>
				</tr>
				<tr>
					<td class='field'>项目编号</td>
					<td>
						<input class="textInput" id="projectNo" value="${entity ne null ? entity.process.project.projectNo : ''}" name="projectNo" type="text" style="width: 90%;" readonly />
					</td>
					<td class='field'>项目名称</td>
					<td colspan="3">
						<input class="textInput" error_message="请输入`项目名称`" id="projectName" name="projectName" value="${entity ne null ? entity.process.project.projectName : ''}" type="text" style="width: 97%;" readonly />
					</td>
					<td class='field'>所属行业</td>
					<td>
						<input type="text" style="width: 90%" value="${entity ne null && entity.process.project.projectType ne null ? entity.process.project.projectType.dictKey : ''}" readonly />
					</td>
				</tr>
				<tr>
					<td class='field'>项目推荐时间</td>
					<td>
						<input name="projectRecommendedDate" error_message="请输入`项目推荐时间`" class="textInput" value="<fmt:formatDate value='${entity.process.project.projectRecommendedDate}' type='date' pattern='yyyy-MM-dd'/>" format="yyyy-MM-dd" type="text" style="width: 90%;" readonly />
					</td>
					<td class='field'>项目推荐人</td>
					<td style="${op ne null && op eq 'view' || op eq 'audit' || op eq 'post_stuff' ? '' : 'padding-left: 5px;'}">
						<input class="" type="text" value="${entity ne null && entity.process.project.projectReferralName ne null ? entity.process.project.projectReferralName : ''}" readonly />
					</td>
					<td class='field'>项目发明人</td>
					<td>
						<input class="" name="projectInventor" type="text" value="${entity ne null && entity.process.project.projectInventor ne null ? entity.process.project.projectInventor : ''}" style="width: 90%;" readonly />
					</td>
					<td class='field'>发明人联系方式</td>
					<td>
						<input id="projectInventorContact" name="projectInventorContact" value="${entity ne null && entity.process.project.projectInventorContact ne null ? entity.process.project.projectInventorContact : ''}" type="text" style="width: 90%;" ${op ne null && op eq 'view' || op eq 'audit' || op eq 'post_stuff' ? 'readonly' : ''}/>
					</td>
				</tr>
				<tr>
					<td class='field' <c:if test="${op eq 'allocate' || op eq 'reallocate'}">style="background-color: red;"</c:if>>项目经理</td>
					<td>
						<input type="text" name="manager.username" value="${entity ne null && entity.process.project.projectManager ne null ? entity.process.project.projectManager.username : ''}" style="width: 90%;" readonly />
					</td>
					<td class='field'>参与人员</td>
					<td colspan="5">
						<input id="project_participants" type="text" name="projectAttendeeIds" style="width: 97%; " value="${entity ne null ? entity.process.project.projectAttendeeIds : ''}" ${op ne null && op eq 'view' || op eq 'audit' || op eq 'post_stuff' ? 'readonly' : ''}/>
					</td>
				</tr>
				<tr>
					<td class='field'>合作方类型<b style="color: red; margin-left: 4px;">*</b></td>
					<td>
						<input type="text" value="${entity ne null && entity.process.project.projectPartnerType ne null ? entity.process.project.projectPartnerType.dictKey : ''}" readonly />
					</td>
					<td class='field'>合作方名称</td>
					<td>
						<input class="required" id="projectPartnerName" error_message="请选择`合作方名称`"name="projectPartnerName" value="${entity ne null ? entity.process.project.projectPartnerName : ''}" type="text" style="width: 90%;" ${op ne null && op eq 'view' || op eq 'audit' || op eq 'post_stuff' ? 'readonly' : ''}/>
					</td>
					<td class='field'>合作方参与人员</td>
					<td colspan="3">
						<input id="project_partnerAttendees" name="projectPartnerAttendeeIds" value="${entity ne null ? entity.process.project.projectPartnerAttendeeIds : ''}" type="text" style="width: 95%;" readonly />
					</td>
				</tr>
				<tr>
					<td class='field'>申请理由</td>
					<td colspan="9">
						<input type="text" style="width: 98%" value="${entity ne null ? entity.reason : ''}" readonly />
					</td>
				</tr>
				<tr>
					<td class='field'>项目摘要</td>
					<td colspan="9">
						<textarea name="projectSummary" rows="2" style="width: 98%; height: 150px; margin: 5px;" readonly>${entity ne null ? entity.process.project.projectSummary : ''}</textarea>
					</td>
				</tr>
			</table>
		</div>
		
		<input type="hidden" name="id" value="${entity ne null ? entity.id : -1}" />
		<input type="hidden" name="op" value="${op ne null ? op : ''}" />
	</div>
	<div class="formBar">
		<ul>
			<li style="margin-right: 20px">
				<label style="float:left; position: relative; top: 5px;">审核意见：</label>
				<input type="text" class="textInput" value="" style="width: 300px" name="auditComments" />
				<input type="radio" name="auditState" value="1" class="state_normal" />通过 
				<input type="radio" name="auditState" value="-1" class="state_normal"/>否决
			</li>
			<li>
				<input type="hidden" name="projectId" value="${pid}" />
				<div class="buttonActive"><div class="buttonContent"><button type="button" id="audit_post_confer">提交</button></div></div>
			</li>
		</ul>
	</div>
</form>
